package nc.ui.acm.bd.tradecorp;

import java.awt.Component;

import javax.swing.JTree;
import javax.swing.tree.DefaultTreeCellRenderer;

import nc.ui.trade.pub.VOTreeNode;
import nc.vo.acm.bd.corpprop.CorppropVO;

public class TradeCorpRender extends DefaultTreeCellRenderer {

	public TradeCorpRender() {
		super();
	}

	public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
		Component obj = super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
		if (value instanceof VOTreeNode) {
			CorppropVO val = (CorppropVO) ((VOTreeNode) value).getData();
			if (val != null) {
				setText(val.getCode() + " " + val.getName());
			}
		}
		return obj;
	}
}
